Release 10.1A: OpenEdge Development:
Programming Interfaces
Creating and managing unique object identities
It is often helpful, especially for managing user identities, to obtain a value that is guaranteed to be unique. Unique values are useful anywhere you need to reference some object or data that is guaranteed not to conflict with any other of its type. A common use for unique values is to generate unique session identifiers for client-principal objects, so client login sessions can be recorded uniquely, especially for auditing purposes. Another use is to uniquely store exported client-principal objects for later retrieval to set user identities for state-free AppServer sessions (see the "Managing application user IDs in n-tier applications" section).
Progress provides two 4GL functions that work specifically with unique values, as described in Table 2–7.
When storing unique values to use in database indexes, you need to store them in an efficient character-string format. Progress provides 4GL functions for encoding and decoding
RAW(binary) data as character values for use in indexes, or other purposes where you need character storage for such a value. These functions support two different character formats for encoding and decodingRAWdata:Table 2–8 describes these functions.
For character indexes, the
BASE64-ENCODEfunction works especially well with UUID values. You can convert the 16-byte UUIDRAWvalue to a 24-character Base64 string and remove the two trailing pad characters for a final result containing 22 characters:
For examples of other uses for these encoding and decoding functions, see the "Managing and transporting crypto data" section.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |